import Vue from 'vue';
import VueRouter from 'vue-router'
import { routers } from './router';
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style



Vue.use(VueRouter)
export const router = new VueRouter({
	routes: routers
});

NProgress.configure({ showSpinner: false }) // NProgress Configuration

router.beforeEach(async(to, from, next) => {
  // start progress bar
  NProgress.start()
	next()
})

router.afterEach(() => {
  // finish progress bar
  NProgress.done()
})
